blob: dc8e37b72dce21e2ac7442341512b49911646233 [file] [log] [blame]
Daniel Stenberg911d1352005-09-02 13:40:07 +00001 Date: September 2, 2005
2 Author: Daniel Stenberg <daniel@haxx.se>
3 URL: http://curl.haxx.se/legal/distro-dilemma.html
Daniel Stenberg76d7dfa2005-09-01 08:35:59 +00004
5Condition
6
7 This document is written to describe the sitution as it is right now. libcurl
8 7.14.0 is currently the latest version available. Things may (or perhaps
9 will) of course change in the future.
10
11 This document reflects my view and understanding of these things. Please tell
12 me where and how you think I'm wrong, and I'll try to correct my mistakes.
13
14Background
15
16 The Free Software Foundation has deemed the Original BSD license[1] to be
17 "incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
18 the point is the same: if you distribute a binary version of a GPL program,
19 it MUST NOT be linked with any Original BSD-licenced parts or
20 libraries. Doing so will violate the GPL license. For a long time, very many
21 GPL licensed programs have avoided this license mess by adding an
22 exception[8] to their license. And many others have just closed their eyes
23 for this problem.
24
25 libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto
26 our plates?
27
28 libcurl is only a little library. libcurl can be built to use OpenSSL for its
29 SSL/TLS capabilities. OpenSSL is basically Original BSD licensed[5].
30
31 If libcurl built to use OpenSSL is used by a GPL-licensed application and you
32 decide to distribute a binary version of it (Linux distros - for example -
33 tend to), you have a clash. GPL vs Original BSD.
34
35 This dilemma is not libcurl-specific nor is it specific to any particular
36 Linux distro.
37
38Part of the Operating System
39
40 This would not be a problem if the used lib would be considered part of the
41 uderlying operating system, as then the GPL license has an exception
42 clause[6] that allows applications to use such libs without having to be
43 allowed to distribute it or its sources. Possibly some distros will claim
44 that OpenSSL is part of their operating system.
45
46 Debian does however not take this stance and has officially(?) claimed that
47 OpenSSL is not a required part of the Debian operating system
48
49Debian-legal
50
51 In August 2004 I figured I should start pulling people's attention to this to
52 see if anyone has any bright ideas or if they would dismiss my worries based
53 on some elegant writing I had missed somewhere:
54
55 My post to debian-legal on August 12 2004:
56
57 http://lists.debian.org/debian-legal/2004/08/msg00279.html
58
59 Several people agreed then that this is a known and rather big problem, but
60 the following discussion didn't result in much.
61
62GnuTLS
63
64 With the release of libcurl 7.14.0 (May 2005), it can now get built to use
65 GnuTLS instead of OpenSSL. GnuTLS is a LGPL[7] licensed library that offers a
66 matching set of features as OpenSSL does. Now, you can build and distribute
67 an SSL capable libcurl without including any Original BSD licensed code.
68
69 I believe Debian is the first distro to provide libcurl/GnutTLS packages.
70
71GnuTLS vs OpenSSL
Daniel Stenberg01774762005-09-01 08:43:44 +000072
Daniel Stenberg76d7dfa2005-09-01 08:35:59 +000073 While these two libraries offer similar features, they are not equal. Both
74 libraries have features the other one lacks. libcurl does not (yet) offer a
75 standardized stable ABI if you decide to switch from using libcurl-openssl to
76 libcurl-gnutls or vice versa. The GnuTLS support is very recent in libcurl
77 and it has not been tested nor used very extensively, while the OpenSSL
78 equivalent code has been used and thus matured for more than seven (7) years.
79
80 In August 2005, the debian-devel mailing list discovered the license issue as
81 a GPL licensed application wanted SSL capabilities from libcurl and thus was
82 forced to use the GnuTLS powered libcurl. For a reason that is unknown to me,
83 the application authors didn't want to or was unable to add an exception to
84 their GPL license. Alas, the license problem hit the fan again.
85
86The Better License, Original BSD or LGPL?
87
88 It isn't obvious or without debate to any objective interested party that
89 either of these licenses are the "better" or even the "preferred" one in a
Daniel Stenberge0785ad2005-09-01 15:03:45 +000090 generic situation.
Daniel Stenberg76d7dfa2005-09-01 08:35:59 +000091
92 Instead, I think we should accept the fact that the SSL/TLS libraries and
93 their different licenses will fit different applications and their authors
94 differently depending on the applications' licenses and their general usage
95 pattern (considering how LGPL libraries can be burdonsome for embedded
96 systems usage).
97
98More SSL Libraries
99
100 In libcurl, there's no stopping us here. There are at least a few more Open
101 Source/Free SSL/TLS libraries and we would very much like to support them as
102 well, to offer application authors an even wider scope of choice.
103
104Application Angle of this Problem
105
106 libcurl is built to use one SSL/TLS library. It uses a single fixed name (by
107 default), and applications are built/linked to use that single lib. Replacing
108 one libcurl instance with another one that uses the other SSL/TLS library
109 might break one or more applications (due to ABI differences and/or different
110 feature set). You want your application to use the libcurl it was built for.
111
112Project cURL Angle of this Problem
113
114 We distribute libcurl and everyone may build libcurl with either library. At
115 their choice. This problem is not directly a problem of ours. It merely
116 affects users - GPL application authors only - of our lib as it comes
117 included and delivered on some distros.
118
Daniel Stenberg911d1352005-09-02 13:40:07 +0000119 libcurl has different ABI when built with different SSL/TLS libraries due to
120 two reasons:
121
122 1. No one has worked on fixing this. The mutex/lock callbacks should be set
123 with a generic libcurl function that should use the proper underlying
124 functions.
125
126 2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
127 but simply requires OpenSSL.
128
Daniel Stenberg76d7dfa2005-09-01 08:35:59 +0000129Distro Angle of this Problem
130
131 A distro can provide separate libcurls built with different SSL/TLS libraries
132 to work around this, but at least Debian seems to be very hostile against
133 such an approach, probably since it makes things like devel packages for the
134 different libs collide since they would provide the same include files and
135 man pages etc.
136
137Fixing the Only Problem
138
139 The only problem is thus for distributions that want to offer libcurl
140 versions built with more than one SSL/TLS library.
141
142 Since multiple libcurl binaries using different names are ruled out, we need
143 to come up with a way to have one single libcurl that someone uses different
144 underlying libraries. The best(?) approach currently suggested involves this:
145
146 A new intermediate library (named lib2 so far in the discussions) with the
147 single purpose of providing libcurl with SSL/TLS capabilities. It would have
148 a unified API and ABI no matter what underlying library it would use.
149
150 There would be one lib2 binary provided for each supported SSL/TLS library.
151 For example: lib2-openssl, lib2-gnutls, lib2-yassl, lib2-matrixssl and
152 lib2-nossl. Yes, take note of the last one that provides the lib2 ABI but
153 that lacks the actual powers.
154
155 When libcurl is built and linked, it will be linked against a lib2 with the
156 set ABI.
157
158 When you link an app against libcurl, it would also need to provide one of
159 the (many) lib2 libs to decide what approach that fits the app. An app that
160 doesn't want SSL at all would still need to link with the lib2-nossl lib.
161
162 GPL apps can pick the lib2-gnutls, others may pick the lib2-openssl.
163
164 This concept works equally well both for shared and static libraries.
165
Daniel Stenberge0785ad2005-09-01 15:03:45 +0000166 A positive side effect of this approach could be a more generic "de facto"
167 standard API for SSL/TLS libraries.
168
Daniel Stenberg76d7dfa2005-09-01 08:35:59 +0000169When Will This Happen
170
171 Note again that this is not a problem in curl, it doesn't solve any actual
172 technical problems in our project. Don't hold your breath for this to happen
173 very soon (if at all) unless you step forward and contribute.
174
175 The suggestion that is outlined above is still only a suggestion. Feel free
176 to bring a better idea!
177
178 Also, to keep in mind: I don't want this new concept to have too much of an
179 impact on the existing code. Preferably it should be possible to build the
180 code like today (without the use of lib2), should you decide to ignore the
181 problems outlined in this document.
182
183Footnotes
184
185 [1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6
186 [2] = http://www.fsf.org/licensing/essays/bsd.html
187 [3] = http://www.fsf.org/licensing/licenses/gpl.html
188 [4] = http://curl.haxx.se/docs/copyright.html
189 [5] = http://www.openssl.org/source/license.html
190 [6] = http://www.fsf.org/licensing/licenses/gpl.html end of section 3
191 [7] = http://www.fsf.org/licensing/licenses/lgpl.html
192 [8] = http://en.wikipedia.org/wiki/OpenSSL_exception
Daniel Stenberge0785ad2005-09-01 15:03:45 +0000193
194Feedback/Updates provided by
195
196 Eric Cooper